import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    base: "./", //打包路径
    resolve: {
        alias: {
            "@": path.resolve(__dirname, "./src") // map '@' to './src' 
        },
    },
    server: {
        port: 4000, //启动端口
        open: true,
        proxy: {
            // 选项写法
            '/api': 'http://47.241.189.62:8080/dev-api' //代理网址
        },
        cors: true
    }
})